package com.hskn.hss.module.user.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.hskn.hss.module.role.entity.SysRole;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author hskn
 * @since 2020-11-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "uid", type = IdType.ASSIGN_UUID)
    private String uid;
    @TableField(exist = false)
    private String uids;
    private String account;

    private String password;

    private String salt;

    private String name;

    private String phone;

    private Integer isDepAdmin;

    private Integer platform;

    private String patrolUid;

    private String remark;

    private Date createTime;

    private Date updateTime;
    /**
     * 是否管理员1：是，2
     */
    private Integer isAdmin;

    private String userphoto;


    @TableField(exist = false)
    private Long timestamp;
    @TableField(exist = false)
    private String roleids;
    @TableField(exist = false)
    private String depid;
    @TableField(exist = false)
    private List<SysRole> roles;
    public Boolean isAdmin(){
        return getIsAdmin()==1;
    }

}
